home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / mini / LBX < prev    next >
Text File  |  1998-01-05  |  12KB  |  302 lines

  1.   The LBX Mini-HOWTO
  2.   Paul D. Smith, psmith@baynetworks.com
  3.   v1.04, 11 Dec 1997
  4.  
  5.   LBX (Low Bandwidth X) is an X server extension which performs compres¡
  6.   sion on the X protocol.  It is meant to be used in conjunction with X
  7.   applications and an X server which are separated by a slow network
  8.   connection, to improve display and response time.
  9.  
  10.   1.  Introduction
  11.  
  12.   Low-Bandwidth X (LBX) attempts to recognize that in this day and age,
  13.   not everyone will be a fast LAN hop or two away from the system that
  14.   they are running their applications on.
  15.  
  16.   The X protocol can generate an extraordinary amount of traffic,
  17.   especially for simple-seeming things such as creating new windows.  As
  18.   anyone who has tried to use X over a dial-in modem at 28.8 or even
  19.   higher can attest, creating new X windows can involve an excruciating
  20.   wait.
  21.  
  22.   LBX is fundamentally a compression and caching scheme designed to
  23.   minimize the amount of X traffic generated between two systems.
  24.  
  25.   2.  What's The Status Of LBX?
  26.  
  27.   As of the X Consortium's release of X11R6.3 in December, 1996, LBX is
  28.   a full extension to the X protocol.  For XFree86 folks, that's XFree86
  29.   version 3.3.
  30.  
  31.   3.  Who Can Benefit From LBX?
  32.  
  33.   If you use a modem to dial into a service provider, then run X
  34.   applications on remote machines with their DISPLAYs set to your local
  35.   machine (or vice versa), LBX will speed up that connection.  Also if
  36.   you set DISPLAYs from systems across WANs (other countries, for
  37.   example) or other slow links, LBX can help.
  38.  
  39.   4.  Who Doesn't Need LBX?
  40.  
  41.   LBX is useless, of course, if you're only running applications
  42.   locally, or if you're not running X at all.
  43.  
  44.   Also, if you're running on a fast LAN, LBX won't be much help.  Some
  45.   people say "if LBX cuts down on network traffic, wouldn't it be good
  46.   to use even on fast LANs?"  It might be, if your goal is to reduce
  47.   network traffic.  But if your goal is to get better response time LBX
  48.   probably isn't what you want.  Although it does introduce caching and
  49.   compression, that comes at a cost on both ends (extra memory for
  50.   caching, and extra CPU for decompression).  If your link is fairly
  51.   speedy LBX will probably result in an overall slowdown.
  52.  
  53.   5.  How Does LBX Work?
  54.  
  55.   LBX works by introducing a proxy server at the client side, which
  56.   performs caching and compression.  The X server knows that the client
  57.   is using a proxy server, and decompresses accordingly.
  58.  
  59.   Here's a normal setup for remote X clients.  In our discussion, LOCAL
  60.   is always the workstation sitting in front of you, whose monitor
  61.   you're looking at, and REMOTE is the remote workstation, where the
  62.   actual application is running.
  63.  
  64.        ______________________________________________________________________
  65.             REMOTE                               LOCAL
  66.         +-----+                                             +-----+
  67.         | APP |-\          Network            +----------+  |     |\
  68.         +-----+  \--------------------------->| X SERVER |=>|     ||
  69.         +-----+  /       (X Protocol)         +----------+  +-----+\
  70.         | APP |-/                                          /_____//
  71.         +-----+
  72.        ______________________________________________________________________
  73.  
  74.   When using LBX, a proxy server (lbxproxy) is introduced on the remote
  75.   side, and the applications talk to that process instead of directly to
  76.   the LOCAL server.  That process then performs the caching and
  77.   compression of X requests and forwards them.  It looks like this:
  78.  
  79.        ______________________________________________________________________
  80.             REMOTE                                         LOCAL
  81.                                                                       +-----+
  82.         +-----+  +-------+           Network            +----------+  |     |\
  83.         | APP |->| PROXY |----------------------------->| X SERVER |=>|     ||
  84.         +-----+  +-------+       (LBX/X Protocol)       +----------+  +-----+\
  85.         +-----+   /                                                  /_____//
  86.         | APP |--/
  87.         +-----+
  88.        ______________________________________________________________________
  89.  
  90.   Details on exactly what caching and compression LBX does is beyond the
  91.   scope of this document.
  92.  
  93.   6.  What Do I Need To Use LBX?
  94.  
  95.   You need an X server on your LOCAL system which has the LBX extension
  96.   compiled in.  Unless you explicitly told it not to when building it,
  97.   X11R6.3 servers automatically enable LBX.  Also, all XFree86 3.3
  98.   servers have LBX enabled by default.
  99.  
  100.   You can use the xdpyinfo command to see if your server has the LBX
  101.   extension: run xdpyinfo and look at the list just under "number of
  102.   extensions"; you should see "LBX" listed there.
  103.  
  104.   Next, you need to get an lbxproxy program compiled for the REMOTE
  105.   system.  This is the tricky part.  If the remote system is not the
  106.   same type as your local system, the lbxproxy on your local system will
  107.   do you no good, of course.
  108.  
  109.   There is unfortunately no "broken out" distribution of lbxproxy, so
  110.   you will have to either (a) get and build most, if not all, of X11R6.3
  111.   for the remote system, or (b) find someplace to get a pre-compiled
  112.   lbxproxy binary for your system.  The latter is much simpler of
  113.   course.
  114.  
  115.   The lbxproxy is simply a single executable.  There are no
  116.   configuration files, resource files, etc. associated with it.
  117.  
  118.   7.  What Don't I Need To Use LBX?
  119.  
  120.   The REMOTE system does not need a new X server (as always, the REMOTE
  121.   system doesn't need any X server running).
  122.  
  123.   The application you want to run does not need to be linked with any
  124.   special version of X, or any special libraries; I regularly use
  125.   commercial X11R5 apps over LBX with no trouble.
  126.  
  127.   You do not need root or other privileged access on the REMOTE system;
  128.   the lbxproxy process runs under your normal access permissions.
  129.   Further, you can run it right from your home directory: it does not
  130.   have to be installed anywhere.
  131.  
  132.   8.  How Do I Start LBX?
  133.  
  134.   OK, here it is... after all that it's actually quite simple.  Replace
  135.   LOCAL and REMOTE below with the hostnames of your local workstation
  136.   and remote system, respectively (don't get them mixed up!)
  137.  
  138.   On LOCAL:
  139.  
  140.   1. Start your X server.
  141.  
  142.   2. Tell your X server that the remote system is allowed access.  Using
  143.      the host-list method, type xhost +REMOTE.  If you use xauth you may
  144.      need to do more than this; see the xauth(1) man page for more
  145.      information.
  146.  
  147.      You should consult the Remote X Apps Mini-HOWTO
  148.      <http://www.xs4all.nl/~zweije/xauth.html> if you're not familiar
  149.      with remote X access permission setup.
  150.  
  151.   On REMOTE:
  152.  
  153.   1. Start lbxproxy and tell it to forward to the LOCAL X server, like
  154.      this:
  155.  
  156.          $ lbxproxy -display LOCAL:0 :1 &
  157.  
  158.   This tells lbxproxy to use display :1 on the REMOTE system; if that
  159.   system has >1 display already you can use :2 or whatever instead.
  160.  
  161.   2. Set your DISPLAY environment variable to point to the display that
  162.      lbxproxy is providing, instead of the normal display:
  163.  
  164.     $ DISPLAY=:1
  165.     $ export DISPLAY
  166.  
  167.   Or, if you use csh or clones:
  168.  
  169.          % setenv DISPLAY :1
  170.  
  171.   3. If you're using xauth you will need to ensure that your cookie is
  172.      available locally.  See the Remote X Apps Mini-HOWTO
  173.      <http://www.xs4all.nl/~zweije/xauth.html> for more information on
  174.      this.
  175.  
  176.   4. Start your X applications!
  177.  
  178.   That's it; all X apps that are started up pointing to :1 will use LBX.
  179.   Of course, there's no reason you couldn't also start X apps pointing
  180.   to LOCAL:0 and have both running at the same time.
  181.  
  182.   9.  Problems
  183.  
  184.   Here are some common problems:
  185.  
  186.      Q) lbxproxy exits with an "access denied" error.
  187.  
  188.      A) This means the LOCAL system isn't accepting connections from the
  189.         REMOTE system due to permissions errors.  See the Remote X Apps
  190.         Mini-HOWTO <http://www.xs4all.nl/~zweije/xauth.html> for details
  191.         on these issues.
  192.  
  193.         As a simple trouble-shooting measure, try running a simple X app
  194.         like xclock on REMOTE and have it display on the local system
  195.         without using lbxproxy:
  196.  
  197.             $ xclock -display LOCAL:0
  198.  
  199.      If that doesn't work, it's xhost or some other basic X problem, not
  200.      LBX.
  201.  
  202.   10.  Documentation
  203.  
  204.   The only documentation available in a standard X distribution may be
  205.   the lbxproxy(1) man page.
  206.  
  207.   If you have access to the X source tree, then very interesting
  208.   information on LBX is available there:
  209.  
  210.   ╖  xc/doc/specs/Xext/lbx.mif (Framemaker MIF)
  211.  
  212.   ╖  xc/doc/hardcopy/Xext/lbx.PS.Z (Compressed Postscript)
  213.  
  214.   ╖  xc/doc/hardcopy/Xext/lbxTOC.html (HTML)
  215.  
  216.   More detailed discussion of specific LBX algorithms is available here:
  217.  
  218.   ╖  xc/doc/specs/Xext/lbxalg.mif (Framemaker MIF)
  219.  
  220.   ╖  xc/doc/specs/Xext/lbxalg.PS.Z (Compressed Postscript)
  221.  
  222.   If you don't have access to the X11 source, you can obtain these files
  223.   from the X Consortium's FTP site <ftp://ftp.x.org/pub/R6.3/xc/doc/>.
  224.  
  225.   11.  Alternatives
  226.  
  227.   If you don't like lbxproxy for some reason: you're not satisfied with
  228.   the performance, it doesn't work for you, you don't want to hassle
  229.   with creating an lbxproxy for the remote host, or you simply are
  230.   interested in trying other options, there is at least one other
  231.   package for X protocol compression (anyone have others?)
  232.  
  233.   11.1.  dxpc - The Differential X Protocol Compressor
  234.  
  235.   ╖  Original Author: Brian Pane <brianp@cnet.com>
  236.  
  237.   ╖  Current Maintainer: Zachary Vonler <lightborn@mail.utexas.edu>
  238.  
  239.   dxpc <http://ccwf.cc.utexas.edu/~zvonler/dxpc/> works in essentially
  240.   the same way as LBX.  However, to avoid having to implement an X
  241.   extension and modify the X server code, dxpc uses two proxies: one
  242.   that runs on the REMOTE host, like lbxproxy, and one that runs on the
  243.   LOCAL host.
  244.  
  245.   The REMOTE host proxy communicates between the X clients and the LOCAL
  246.   host proxy, and the LOCAL host proxy communicates between the X server
  247.   and the REMOTE host proxy.
  248.  
  249.   So, to both the X clients and the X server, it looks like X protocol
  250.   as usual.
  251.  
  252.   11.1.1.  Advantages
  253.  
  254.   ╖  Since it's a completely separate application that does not require
  255.      any X internals, it's much simpler to compile and install.
  256.  
  257.   ╖  It's maintained separately, so you don't have to wait for the OSF
  258.      to release new X versions for enhancements or fixes.
  259.  
  260.   ╖  It provides more and better compression information and statistics
  261.      than lbxproxy.
  262.  
  263.   11.1.2.  Disadvantages
  264.  
  265.   ╖  It is not a standard part of X; you must obtain and build it
  266.      separately.
  267.   ╖  It is slightly more complex to set up, since it requires a LOCAL-
  268.      side proxy as well as the REMOTE proxy.
  269.  
  270.   11.1.3.  Where Can I Get dxpc?
  271.  
  272.   The source for dxpc is available at ftp.x.org
  273.   <ftp://ftp.x.org/contrib/utilities/>.
  274.  
  275.   There is a WWW homepage for dxpc that gives a lot of good information,
  276.   including pointers to the dxpc mailing list, access to the source
  277.   code, and a number of pre-built binaries for various platforms:
  278.  
  279.   <http://ccwf.cc.utexas.edu/~zvonler/dxpc/>
  280.  
  281.   11.2.  Ssh (Secure Shell)
  282.  
  283.   Ken Chase <lbxhowto@sizone.org> notes that ssh
  284.   <http://www.cs.hut.fi/ssh/> can be used for compression.  Although its
  285.   main purpose is to provide security, it also compresses the data it
  286.   sends.
  287.  
  288.   Thus, if you run X over a ssh link you will automatically obtain some
  289.   amount of compression.
  290.  
  291.   11.3.  Which Is Better?
  292.  
  293.   I don't know.  Both LBX and dxpc are certainly better at raw
  294.   compression than ssh.  Of course, ssh provides the added advantage of
  295.   security.  And of course, there's no reason you can't use both ssh and
  296.   one of the other two, to get good compression and security.
  297.  
  298.   It shouldn't be hard to run some benchmarking against these options
  299.   and get both subjective and statistical measurings of performance.
  300.   But I haven't done this, and I don't know of anyone who has.
  301.  
  302.